<?php $this->action("index","more","header");?>
        <div id="content">
            <div class="main">
      
                
    <h1>编辑公告栏</h1>

                
                
                
<div class="mod">
<form name="bulletin_form" method="post" action=""><div style="display:none;">
<input type="hidden" name="update" value="1"/></div>

<div class="editor-toolbar">
<a id="addlink" href="javascript:void(0)">添加链接</a>
</div>
<div class="item">
<textarea id="text" name="text"><?php echo $content;?></textarea>
</div>
<div class="item-submit">
<span class="bn-flat-hot"><input name="submit" type="submit" value="提交"></span>
&nbsp;&nbsp;
<a href="#" onclick="javascript:history.go(-1)">取消</a>

</div>
</form>
</div>
<script>
Do('dialog','common', function(){
    var templ_link = '<form class="frm-addlink"><div class="item">' +
                        '<label>链接文字: </label><input name="linktext" type="text" value="SEL">' +
                        '</div>' +
                        '<div class="item">' +
                        '<label>网址: </label><input name="href" type="text" value="">' +
                        '</div><input type="submit" style="display:none;"></form>',
        addlink = function(frm, o){
            var text = $.trim(frm[0].elements['linktext'].value),
            url = $.trim(frm[0].elements['href'].value);
            if(url !== ''){
              url = /^http:\/\//.test(url)? url:"http://"+url;
              $('#text').insert_caret('[url=' + url + ']' + (text===''? url : text) + "[/url]");
              o.close();
            }
        };

    $('#addlink').click(function(e){
        e.preventDefault();
        var s = $('#text').get_sel(),
        dlg = dui.Dialog({
        content: templ_link.replace('SEL', s),
        width: 400,
        title: '添加链接',
        buttons: [{
          text: '添加',
          method: function(o){
            addlink( o.node.find('form'), o);
          }
        },'cancel']
        }).open();
        dlg.node.find('form').submit($.proxy(function(e){
            e.preventDefault();
            addlink($(e.target), this);
        }, dlg));
    });
});
</script>


            </div>
            <div class="aside">
                




<div class="mod" id="sp-user">
    <div class="bd">

    </div>
</div>
        
        </div>
       </div>
  <?php $this->partial("/Tpl/Index/MoreAction/doFooter.htm");?>        
</body>
</html>